<template>
  <!-- 巡查详情 —— 违规证明 -->
  <view iew class="violationCertificate">
    <view class="wrapper">
      <view class="picture">
        <image
          v-for="(img, imgIndex) in patrolPath"
          :key="imgIndex"
          :src="imgPrefix + img.path"
          mode=""
          @click="pvwImage([imgPrefix + img.path])"
        ></image>
      </view>

      <view class="vno-con">
        {{ options.violationContent || "" }}
      </view>
    </view>
  </view>
</template>

<script>
import { imagesPathList } from "@/api/api.js";
import { pvwImage } from "@/utils/util.js";

export default {
  name: "violationCertificate",
  data() {
    return {
      baseImgUrl: this.$baseImgUrl,
      imgPrefix: uni.getStorageSync("imgPrefix"),
      options: {},
      patrolPath: [],
    };
  },
  onLoad(options) {
    this.options = options;
    this.getDetail();
  },
  methods: {
    pvwImage,
    getDetail() {
      imagesPathList({ bizId: this.options.id, bizType: 6 }).then((res) => {
        if (res.code == 200) {
          this.patrolPath = res.result;
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.violationCertificate {
  flex: 1;
  background: #f6f6f6;
  overflow-y: auto;
  padding: 16rpx 24rpx;

  .wrapper {
    padding: 24rpx 30rpx;
    background: #fff;
    font-size: 28rpx;
    min-height: calc(100vh - 20px);

    .vno-con {
      margin-bottom: 30rpx;
      font-weight: 500;
      color: #333333;
    }

    .picture {
      display: flex;
      flex-wrap: wrap;
      margin-bottom: 15rpx;
      image {
        display: block;
        margin-right: 30rpx;
        margin-bottom: 25rpx;
        width: 190rpx;
        height: 200rpx;
        border-radius: 8rpx;
      }

      image:nth-of-type(3n) {
        margin-right: 0rpx;
      }

      image:last-child {
        margin-right: 0;
      }
    }
  }
}
</style>
